{% block begin %}
{% endblock %}

{% block title %}
<style type="text/css">
    #main-nav{display: none;}
    .updateProfile{position: absolute;width:342px;height: 480px; left: 50%;top:50%;margin-left: -171px;margin-top: -340px;
        background: url("../web/cssimg/common/up_bj.png") no-repeat;
        padding-top: 30px;
    }
    .updateProfile ._title{font-size: 20px;color: #2b2b2b;font-weight: bold;text-align: center;}
    .updateProfile ._avatar{width: 100px;height:100px;border-radius:50%;border:4px solid #e7e7e7;margin: 34px auto 0 auto;display:block;}
    .updateProfile ._btn{width: 94px;height:32px;background-color: #e46490;border-radius: 4px;color: #fff;text-align: center;line-height: 32px;margin: 26px auto 0 auto;cursor: pointer;}
    .updateProfile ._btn:hover{background-color: #f799c3;}
    .updateProfile ._btn:active{background-color: #ce4381;}
    .updateProfile ._input{margin: 30px 0 0 12px;position: relative;height: 38px;}
    .updateProfile ._input ._nick_text{float: left;line-height: 38px;}
    .updateProfile ._input .up-nickName{position:absolute;left: 50px;width: 205px;height: 14px;padding-left: 12px;line-height: 14px;padding-top: 12px;padding-bottom:12px; z-index: 1; background-color: #CFCFCF;border-radius: 4px;}
    .updateProfile ._input label.up-nickName{z-index: 2;color: #9E9E9E;line-height: 14px;cursor: text;}
    .updateProfile ._input ._tip{line-height: 38px;position: absolute;left: 270px;width: 200px;color:#d10f01;}
    .updateProfile ._submit{width: 210px;height: 50px;color:#fff;cursor: pointer;line-height: 50px;
        text-align: center;letter-spacing:10px;font-size: 16px;margin: 40px auto 0 auto;padding-left: 18px;
        background: url('../web/cssimg/common/dialog-reg-btn.png');
    }
    .updateProfile ._submit:hover{background-position: 0 -52px;}
</style>
{% endblock %}

{% block titleList %}
<!--本页的其他选项、例如V卡、座驾、守护等。-->
{% endblock %}

{% block titleContent %}
<!--例如首页的我要开播等等-->
{% endblock %}

{% block content %}
<div id="updateProfile" class="updateProfile">
    <div class="_title">完善资料</div>
    <img class="_avatar" id="reg-avatar-pre" src="{{ avatar }}">
    <div class="_btn" id="upload-avatar-btn" onclick="avatarModify()">上传头像</div>
    <div class="_input">
        <div class="_nick_text">昵称：</div>
        <label defaultdisplay="default" defaultvalue="请输入昵称" class="up-nickName" onclick="clearNickNameErr()">请输入昵称</label>
        <input type="text" id="reg_input_nickname" class="up-nickName" >
        <div class="_tip" id="nickName_err"></div>
    </div>
    <div class="_submit" onclick="updateNickName()">完成</div>
</div>
<div class="reg-avatar-upload" id="reg-avatar-upload">
    <div class="reg-avatar-close"><i class="d-icon-close" onclick="modifyAvatarCallback('close')"></i></div>
    <div class="reg-avatar-flash" id="reg-avatar-flash"></div>
</div>
{% endblock %}

{% block end %}
<script type="application/javascript">
    function clearNickNameErr(){
        jq('#nickName_err').html('')
    }
    function updateNickName(){
        var data={}
        data.nickname=jq('#reg_input_nickname').val();
        if(data.nickname==''){
            jq('#nickName_err').html('<i class="prompt-icon-error"></i>请输入昵称')
            return 0
        }
        utils.post('/user/updateNickName',data,function(res){
            if(res.code==0){
                location.href= "/"
            }else{
                jq('#nickName_err').html('<i class="prompt-icon-error"></i>'+res.info)
                return 0
            }
        },true)
    }
</script>
{% endblock %}





